package com.shan.design.visitor;

import java.util.ArrayList;

/**
 * description
 * 员工列表类：对象结构
 *
 * @author shanzheng <br/>
 * @date 15:01 2018/11/29.<br/>
 * Modified By <br/>
 */
public class EmployeeList {
    private ArrayList<Employee> list = new ArrayList<>();

    public void add(Employee employee) {
        list.add(employee);
    }

    public void remove(Employee employee) {
        list.remove(employee);
    }

    void accept(Department department) {
        for (Employee employee : list) {
            employee.accept(department);
        }
    }
}
